import logging
import redis


class Config(object):
	DEBUG = True

	SQLALCHEMY_DATABASE_URI = "mysql+pymysql://root:mysql@localhost:3306/information"
	SQLALCHEMY_TRACK_MODIFICATIONS = False
	SQLALCHEMY_COMMIT_ON_TEARDOWN = True

	REDIS_HOST = "127.0.0.1"
	REDIS_PORT = 6379

	SECRET_KEY = "asdfg"

	SESSION_TYPE = "redis"
	SESSION_REDIS = redis.StrictRedis(host=REDIS_HOST,port=REDIS_PORT)
	SESSION_USE_SIGNER = True
	PERMANENT_SESSION_LIFETIME = 3600 * 24 * 2
	# 默认的日志等级
	LEVEL = logging.DEBUG
class DevelopConfig(Config):
	pass
class ProductConfig(Config):
	DEBUG = False
	LEVEL = logging.ERROR
class TestingConfig(Config):
	TESTING = True
config_dict = {
	"develop":DevelopConfig,
	"product":ProductConfig,
	"testing":TestingConfig
}